<include file="Public:header" />
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-8">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="insertForm" method="post" >
                        <div class="form-group">
                            <label class="col-sm-3 control-label">用户名:</label>
                            <div class="input-group col-sm-4">
                                <input id="shopName" type="text" value="{$info['username']}" disabled class="form-control" name="shopName" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">密码:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="password" class="form-control" name="password" required="" aria-required="true"  placeholder="如不修改不需要填写">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">二级密码:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" class="form-control" name="twopassword" required="" aria-required="true" placeholder="如不修改不需要填写">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">昵称:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['realname']}" class="form-control" name="realname" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">电话号码:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['phone']}" class="form-control" name="phone" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">邮箱地址:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['email']}" class="form-control" name="email" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">身份证号:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['idcard']}" class="form-control" name="idcard" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系地址:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['address']}" class="form-control" name="address" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">微信:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['wechat']}" class="form-control" name="wechat" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">qq:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['qq']}" class="form-control" name="qq" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">传真:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['tel']}" class="form-control" name="tel" required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">推荐人:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['tuiuser']['username']}" class="form-control" disabled required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">接点人:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['jieuser']['username']}" class="form-control" disabled required="" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">等级:</label>
                            <div class="input-group col-sm-4">
                                	<select class="form-control" name="level">
                                		<volist name="level" id="vo">
										  <option <eq name="vo['id']" value="$info['leavel']">selected</eq> value="{$vo['id']}">{$vo['name']}</option>
										</volist>
									</select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">区域:</label>
                            <div class="input-group col-sm-4">
                                <input id="loginName" type="text" value="{$info['quyu']|getQuyuName=###}" class="form-control" disabled required="" aria-required="true">
                            </div>
                        </div>
						<div class="form-group">
                            <label class="col-sm-3 control-label">锁定:</label>
                            <div class="input-group col-sm-4">
								<select class="form-control" name="lock">
								  <option <empty name="info['lock']">selected</empty> value="0">开启</option>
								  <option <eq name="info['lock']" value="1">selected</eq>  value="1">锁定</option>
								</select>
                            </div>
                        </div>
                        <!--<div class="form-group">
                            <label class="col-sm-3 control-label">荣誉级别:</label>
                            <div class="input-group col-sm-4">
								<select class="form-control" name="honor_leavel">
								  <option <empty name="info['honor_leavel']">selected</empty> value="0">暂无</option>
								  <option <eq name="info['honor_leavel']" value="1">selected</eq>  value="1">精灵</option>
								  <option <eq name="info['honor_leavel']" value="2">selected</eq>  value="2">红精灵</option>
								  <option <eq name="info['honor_leavel']" value="3">selected</eq>  value="3">黄精灵</option>
								  <option <eq name="info['honor_leavel']" value="4">selected</eq>  value="4">蓝精灵</option>
								  <option <eq name="info['honor_leavel']" value="5">selected</eq>  value="5">精灵合伙人</option>
								</select>
                            </div>
                        </div>-->
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <input value="{$info['id']}" class="form-control" name="id" type="hidden" required="" aria-required="true">
                                <button class="btn btn-primary" type="button" onclick="toVaild()">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>
<include file="Public:footer" />
<script type="text/javascript">

    //表单提交
    function toVaild(){
        var jz;
        var url = "{:U('User/updateFormSub')}";
        $.ajax({
            type:"POST",
            url:url,
            data: $('#insertForm').serialize(),// 你的formid
            async: false,
            beforeSend:function(){
                jz = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
            },
            error: function(request) {
                layer.close(jz);
                swal("网络错误!", "", "error");
            },
            success: function(data) {
                //关闭加载层
                layer.close(jz);
                if(data['status'] == true){
                    swal(data.info, "", "success");setTimeout("location.reload()",1000); 
                }else{
                    swal(data.info, "", "error");
                }

            }
        });

        return false;
    }

</script>
</body>
</html>